﻿<%@ Page Language="C#" MasterPageFile="~/ProductManager/ProductManage.Master" AutoEventWireup="true" CodeFile="AddDiscontPrdts.aspx.cs" Inherits="ProductManager_AddDiscontPrdts" Title="无标题页" %>
<%@ MasterType VirtualPath="ProductManage.Master" %> 
<%@ Register Assembly="GoShopping.Components" Namespace="BaseText" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<%--<script type="text/javascript">
function GetAndSetProPrdtName(btn)
{
    var prdtProName=document.getElementById("ctl00_ContentPlaceHolder1_lblName");
    prdtProName.innerHTML=btn.innerHTML;
    //event.returnValue=false;
}
</script>--%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <table class="style1" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width: 100px">
                    商品类型:</td>
                <td style="width: 200px">
                    <asp:DropDownList ID="ddlType" runat="server" Width="126px" AutoPostBack="True" 
                        onselectedindexchanged="ddlType_SelectedIndexChanged">
                    </asp:DropDownList>
                </td>
                <td style="width: 250px">
                    <%--商品名称:<cc1:ZLTextBox ID="txtSearchName" runat="server"/><asp:Button ID="btnSearch" runat="server" Text="搜索" />--%></td>
                <td>
                </td>
            </tr>
            <tr>
                <td colspan="4">
                    设置商品为折扣商品:</td>
            </tr>
         </table>
        <table class="style1" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width:400px" valign="top">
                    <asp:GridView ID="extGVPromotedPrdt" runat="server" 
                        AllowPaging="True" AutoGenerateColumns="False" 
                        RecordCount="-1" Width="400px" 
                        onpageindexchanging="extGVPromotedPrdt_PageIndexChanging" 
                        onrowcommand="extGVPromotedPrdt_RowCommand">
                        <Columns><asp:TemplateField HeaderText="ID" Visible="False"><ItemTemplate><asp:Label ID="lblID" runat="server" Text='<%# Eval("ID") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="商品名称" HeaderStyle-HorizontalAlign="Left"><ItemTemplate><asp:LinkButton ID="btnName" runat="server" Text='<%# Eval("Name") %>' CommandName="PrdtEdit" CommandArgument='<%# Eval("ID") %>' CausesValidation="false"></asp:LinkButton></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="当前价格" HeaderStyle-HorizontalAlign="Left"><ItemTemplate><asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="供应商" HeaderStyle-HorizontalAlign="Left"><ItemTemplate><asp:Label ID="lblSupplyer" runat="server" Text='<%# GetRelatedColumn.GetSupplyerName(Eval("SupplyerID")) %>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField HeaderText="操作" HeaderStyle-HorizontalAlign="Center" Visible="false"><ItemTemplate><asp:ImageButton runat="server" ID="btnDel" CommandName="btnDel" CommandArgument='<%# Eval("ID") %>'/></ItemTemplate><HeaderStyle HorizontalAlign="Center"></HeaderStyle><ItemStyle HorizontalAlign="Center" /></asp:TemplateField></Columns><HeaderStyle HorizontalAlign="Left" /></asp:GridView>
                </td>
                <td style="width:400px">
                    <div>
                    <input id="hidPrdtId" type="hidden" runat="server"/>
                    <p>折扣商品：<asp:Label ID="lblName" runat="server"></asp:Label></p>
                    <%--<p style="vertical-align: middle">图片路径：<cc1:ZLTextBox ID="txtProImg" runat="server"/></p>--%>
                    <input id="hidImgPro" type="hidden" runat="server" />
                    <p>折扣价格：<cc1:ZLTextBox ID="zlTxtOffPrice" runat="server"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ErrorMessage="RequiredFieldValidator" ControlToValidate="zlTxtOffPrice" 
                            Display="Dynamic">不能为空！</asp:RequiredFieldValidator>
                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                            ControlToValidate="zlTxtOffPrice" ErrorMessage="RangeValidator" 
                            MinimumValue="0" Type="Double" Display="Dynamic" MaximumValue="1000000">不能小于0！</asp:RangeValidator>
                        </p>
                    <p>起始时间：<cc1:ZLTextBox ID="zlTxtStartTime" runat="server" InputType="date"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ErrorMessage="RequiredFieldValidator" ControlToValidate="zlTxtStartTime" 
                            Display="Dynamic">不能为空！</asp:RequiredFieldValidator>
                        </p>
                    <p>终止时间：<cc1:ZLTextBox ID="zlTxtEndTime" runat="server" InputType="date"/>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ErrorMessage="RequiredFieldValidator" ControlToValidate="zlTxtEndTime">不能为空！</asp:RequiredFieldValidator>
                        </p>
                                        <p style="vertical-align: middle">描述：<cc1:ZLTextBox ID="txtProDescrip" runat="server" TextMode="MultiLine"/></p>
                    <p><asp:Button ID="btnAddPromoted" runat="server" Text="添加" 
                            onclick="btnAddPromoted_Click" />                                  
                        </p>
                    </div>
                    </td>
            </tr>
            <tr>
                <td style="width:400px">
                    &nbsp;</td>
                <td style="width:400px">
                    &nbsp;</td>
            </tr>
        </table>
        <table class="style1" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    折扣商品列表</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="extGVProPrdt" runat="server" 
                        AllowPaging="True" AutoGenerateColumns="False" 
                        PagerText="当前第{0}页,共{1}页{2}条记录" RecordCount="-1" Width="800px" 
                        onpageindexchanging="extGVProPrdt_PageIndexChanging" 
                        onrowcommand="extGVProPrdt_RowCommand"><Columns><asp:TemplateField HeaderText="商品名称"><ItemTemplate><asp:LinkButton ID="lblName" runat="server" Text='<%# GetPrdtName(Eval("PrdctID")) %>' CommandName="PrdtEdit" CommandArgument='<%# Eval("ID") %>'></asp:LinkButton></ItemTemplate></asp:TemplateField>
                            <asp:BoundField DataField="StartDate" DataFormatString="{0:d}" 
                                HeaderText="开始时间" />
                            <asp:BoundField DataField="EndDate" DataFormatString="{0:d}" 
                                HeaderText="结束时间" />
                            <asp:BoundField DataField="DiscountPrice" HeaderText="折扣价" />
                            <%--<asp:TemplateField HeaderText="图片路径" Visible="False"><ItemTemplate><asp:Label ID="lblImgSrc" runat="server" Text='<%# Eval("Src") %>'></asp:Label></ItemTemplate></asp:TemplateField>--%>
                            <asp:TemplateField HeaderText="操作" HeaderStyle-HorizontalAlign="Center"><ItemTemplate><asp:ImageButton ImageUrl="" runat="server" ID="btnDel" CommandName="PrdtDel" CommandArgument='<%# Eval("ID") %>'/></ItemTemplate><HeaderStyle HorizontalAlign="Center" /><ItemStyle HorizontalAlign="Center" /></asp:TemplateField></Columns><HeaderStyle HorizontalAlign="Left" /></asp:GridView>
                </td>
            </tr>
        </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

